﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Discussions.master" AutoEventWireup="false" CodeFile="DiscussionHome.aspx.vb" Inherits="DiscussionHome" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<h2>Welcome to the site, please log in</h2>
</AnonymousTemplate>

<LoggedInTemplate>
<fieldset>
<fieldset>
<legend>Tags</legend>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:BoundField DataField="Tag" HeaderText="Tag" SortExpression="Tag" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT * FROM [QDiscussionTag]"></asp:SqlDataSource>
</fieldset>
<br />
<form action="" class="input-frm">
       <h1>Top Rated Discussions
        <span>Discussions that are most popular among visitors</span>
    </h1>

        </form>
<br />
<form action="" class="input-frm">
       <h1>Recently Added Discussions
        <span>Five recently created discussions</span>
    </h1>
     <asp:GridView ID="DSArticles" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="DSRecent">
        <Columns>
            <asp:BoundField DataField="Topic" HeaderText="Topic" SortExpression="Topic" />
            <asp:HyperLinkField DataNavigateUrlFields="ID" 
                DataNavigateUrlFormatString="DiscussionDetails.aspx?ID={0}" 
                HeaderText="View Discussion" Text="Enter" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="DSRecent" runat="server" 
        ConnectionString="<%$ ConnectionStrings:myFirstDatabase %>" 
        ProviderName="<%$ ConnectionStrings:myFirstDatabase.ProviderName %>" 
        SelectCommand="SELECT * FROM [QRecentAddDiss]"></asp:SqlDataSource>
        </form>
</LoggedInTemplate>
</asp:LoginView>
</asp:Content>

